<!DOCTYPE html>

<html class="no-js">

<head>
  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <title></title>
  <meta name="description" content="" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <script src="https://cdn.staticfile.org/axios/0.19.0-beta.1/axios.js"></script>
  <script src="../../cdn/vue/vue.global.min.js"></script>
  <link rel="stylesheet" href="../../cdn/element-plus/index.css" />
  <script src="../../cdn/element-plus/index.full.min.js"></script>
  <link rel="stylesheet" href="../../../lib/index.css" />
  <script src="../../../lib/avue.js"></script>
  <style>
    #test {
      position: relative;
      width: 300px;
      height: 300px;
      border: 1px solid #ccc;
    }
  </style>
</head>

<body>
  <div id="app">
    <el-button @click="submit" type="primary">全局水印</el-button>
    <el-button @click="submit1" type="primary">局部水印</el-button>
    <el-button @click="del" type="danger">删除水印</el-button>
    <br /><br />
    <div id="test"></div>
  </div>
</body>
<script>
  var app = Vue.createApp({
    data() {
      return {
        obj: '',
        obj1: ''
      }
    },
    methods: {
      submit() {
        this.$message.success('添加水印成功')
        this.obj = this.$Watermark({ text: 'avue全局水印演示' })
      },
      submit1() {
        this.$message.success('添加水印成功')
        this.obj1 = this.$Watermark({ id: 'test', fontSize: '14px', width: 120, height: 80, text: 'avue局部水印演示' })
      },
      del() {
        this.obj.remove();
        this.obj1.remove();
      },
    }
  })
  app.use(ElementPlus)
  app.use(AVUE)
  app.mount('#app')
</script>

</html>